﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace Qplus.UI
{
    public partial class PersonalSettingControl : UserControl
    {
        public PersonalSettingControl()
        {
            InitializeComponent();
            unknowRbtn.IsChecked = true;
        }

        private void maleBtn_Click(object sender, RoutedEventArgs e)
        {
            if (maleRbtn.IsChecked == false)
            {
                maleRbtn.IsChecked = true;
            }
        }

        private void femaleBtn_Click(object sender, RoutedEventArgs e)
        {
            if (femaleRbtn.IsChecked == false)
            {
                femaleRbtn.IsChecked = true;
            }
        }

        private void unknowBtn_Click(object sender, RoutedEventArgs e)
        {
            if (unknowRbtn.IsChecked == false)
            {
                unknowRbtn.IsChecked = true;
            }
        }

        private void maleRbtn_Checked(object sender, RoutedEventArgs e)
        {
            maleImgSelect.Visibility = System.Windows.Visibility.Visible;
            maleImgUnSelect.Visibility = System.Windows.Visibility.Collapsed;
            maleTxtBlk.Foreground = new SolidColorBrush(Colors.Blue);
        }

        private void maleRbtn_Unchecked(object sender, RoutedEventArgs e)
        {
            maleImgSelect.Visibility = System.Windows.Visibility.Collapsed;
            maleImgUnSelect.Visibility = System.Windows.Visibility.Visible;
            maleTxtBlk.Foreground = new SolidColorBrush(Colors.White);
        }

        private void femaleRbtn_Checked(object sender, RoutedEventArgs e)
        {
            femaleImgSelect.Visibility = System.Windows.Visibility.Visible;
            femaleImgUnSelect.Visibility = System.Windows.Visibility.Collapsed;
            femaleTxtBlk.Foreground = new SolidColorBrush(Colors.Red);
        }

        private void femaleRbtn_Unchecked(object sender, RoutedEventArgs e)
        {
            femaleImgSelect.Visibility = System.Windows.Visibility.Collapsed;
            femaleImgUnSelect.Visibility = System.Windows.Visibility.Visible;
            femaleTxtBlk.Foreground = new SolidColorBrush(Colors.White);
        }

        private void unknowRbtn_Checked(object sender, RoutedEventArgs e)
        {
            unknowImgSelect.Visibility = System.Windows.Visibility.Visible;
            unknowImgUnSelect.Visibility = System.Windows.Visibility.Collapsed;
            unknowTxtBlk.Foreground = new SolidColorBrush(Colors.Green);
        }

        private void unknowRbtn_Unchecked(object sender, RoutedEventArgs e)
        {
            unknowImgSelect.Visibility = System.Windows.Visibility.Collapsed;
            unknowImgUnSelect.Visibility = System.Windows.Visibility.Visible;
            unknowTxtBlk.Foreground = new SolidColorBrush(Colors.White);
        }

        private void birthdayTxtBox_GotFocus(object sender, RoutedEventArgs e)
        {
            birthdayTxtBox.Text = "";
        }

        private void nicknameBtnEx_Click(object sender, RoutedEventArgs e)
        {
            birthdayTxtBox.Focus();
        }

        private void emailTxtBox_GotFocus(object sender, RoutedEventArgs e)
        {
            emailTxtBox.Text = "";
        }

        private void emailBtnEx_Click(object sender, RoutedEventArgs e)
        {
            emailTxtBox.Focus();
        }

        private void birthdayBtnEx_Click(object sender, RoutedEventArgs e)
        {
            DatePicker datePick1 = new DatePicker();
            //datePick1.ValueChanged += datePicker_ValueChanged;
        }

        private void okBtnEx_Click(object sender, RoutedEventArgs e)
        {
            this.CloseMeAsPopup();
        }

        private void disturbBtnEx_Click(object sender, RoutedEventArgs e)
        {
            if (distrubChkBox.IsChecked == true)
            {
                distrubChkBox.IsChecked = false;
            }
            else if (distrubChkBox.IsChecked == false)
            {
                distrubChkBox.IsChecked = true;
            }
            else
            {
                //something wrong
            }
        }

        private void distrubChkBox_Checked(object sender, RoutedEventArgs e)
        {
            uncheckedImg.Visibility = System.Windows.Visibility.Collapsed;
            checkedImg.Visibility = System.Windows.Visibility.Visible;
        }

        private void distrubChkBox_Unchecked(object sender, RoutedEventArgs e)
        {
            checkedImg.Visibility = System.Windows.Visibility.Collapsed;
            uncheckedImg.Visibility = System.Windows.Visibility.Visible;
        }
    }
}
